$(function () {
    cuisineFindAll();
});

function cuisineFindAll() {
    $.ajax({
        url: '/back/cuisine/findAll',
        data: {},
        type: 'get',
        dataType: 'json',
        success: function (res) {
            setCuiseneHtml(res.data);
        }
    })
}

function setCuiseneHtml(data) {
    console.log(data);
    let html = '';
    for (let i = 0; i < data.length; i++) {
        html += ' <option value="' + data[i].id + '">' + data[i].name + '</option>';
    }
    $("#cuisine").html(html);
    formFlush();
}

function formFlush() {
    layui.use(['laydate', 'form', 'layer', 'jquery'],
        function () {
            $ = layui.jquery;
            var form = layui.form;
            form.render();
        })
}